package com.chenfan.mcn.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chenfan.mcn.extension.log.FieldDesc;
import com.chenfan.mcn.constant.NumberFormatCst;
import com.chenfan.mcn.enums.LiveStarSettlementStatusEnum;
import com.chenfan.mcn.extension.log.FieldTypeEnum;
import com.chenfan.mcn.component.dict.ContractingIdTranslator;
import com.chenfan.mcn.component.dict.StarAccountInfoIdTranslator;
import com.chenfan.mcn.component.dict.StarBasicDataIdTranslator;
import com.chenfan.mcn.model.base.BaseOwnerEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 直播红人结算单
 * </p>
 *
 * @author wulg
 * @since 2023-03-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("live_star_settlement")
public class LiveStarSettlement extends BaseOwnerEntity {

    /**
     * 结算单号
     */
    @TableField("settlement_code")
    private String settlementCode;

    /**
     * 单据状态：0_待提交、1_审批中、2_待打款、3_审批拒绝、4_已撤回、5_部分打款、6_已打款、9_已作废
     */
    @FieldDesc(value ="单据状态", translator = LiveStarSettlementStatusEnum.class)
    @TableField("approval_status")
    private Integer approvalStatus;

    /**
     * 红人ID
     */
    @FieldDesc(value ="红人昵称", translator = StarBasicDataIdTranslator.class)
    @TableField("star_id")
    private Long starId;

    /**
     * 主播信息确认截图
     */
    @FieldDesc(value ="主播信息确认截图", fieldType = FieldTypeEnum.IMAGE)
    @TableField("confirm_screenshot")
    private String confirmScreenshot;

    /**
     * 附件
     */
    @FieldDesc(value ="附件", fieldType = FieldTypeEnum.FILE)
    @TableField("attachment_file")
    private String attachmentFile;

    /**
     * 费用明细(附件上传)
     */
    @FieldDesc(value ="费用明细")
    @TableField("charge_attachment_file")
    private String chargeAttachmentFile;

    /**
     * 结算月份（精确到月）
     */
    @JSONField(format = "yyyy-MM")
    @FieldDesc(value ="结算月份", format = "yyyy-MM")
    @TableField("settlement_date")
    private Date settlementDate;

    /**
     * 我司财务主体id（取【公司管理】的数据）
     */
    @FieldDesc(value ="我司财务主体", translator = ContractingIdTranslator.class)
    @TableField("contracting_id")
    private Long contractingId;

    /**
     * 备注
     */
    @FieldDesc(value ="备注")
    @TableField("remark")
    private String remark;

    /**
     * 红人收款账户ID
     */
    @FieldDesc(value ="收款账户", translator = StarAccountInfoIdTranslator.class)
    @TableField("star_account_id")
    private Long starAccountId;

    /**
     * 成交金额（结算）
     */
    @FieldDesc(value ="成交金额（结算）", format = NumberFormatCst.AMOUNT)
    @TableField("transacted_total_amount")
    private BigDecimal transactedTotalAmount;

    /**
     * 结算总金额
     */
    @FieldDesc(value ="结算金额", format = NumberFormatCst.AMOUNT)
    @TableField("settlement_total_amount")
    private BigDecimal settlementTotalAmount;

    /**
     * 结算总佣金
     */
    @FieldDesc(value ="结算佣金", format = NumberFormatCst.AMOUNT)
    @TableField("settlement_total_commission")
    private BigDecimal settlementTotalCommission;

    /**
     * 费用金额
     */
    @FieldDesc(value ="费用金额")
    @TableField("charge_amount")
    private BigDecimal chargeAmount;

    /**
     * 应扣税额
     */
    @FieldDesc(value ="应扣税额", format = NumberFormatCst.AMOUNT)
    @TableField("taxable_amount")
    private BigDecimal taxableAmount;

    /**
     * 打款金额
     */
    @FieldDesc(value ="打款金额", format = NumberFormatCst.AMOUNT)
    @TableField("payment_amount")
    private BigDecimal paymentAmount;

    /**
     * 打款备注
     */
    @FieldDesc(value ="打款备注")
    @TableField("payment_remark")
    private String paymentRemark;

    /**
     * 最近回款日期
     */
    @FieldDesc(value ="最近回款日期")
    @TableField("payback_date")
    private Date paybackDate;

    /**
     * 累计回款金额
     */
    @FieldDesc(value ="累计回款金额")
    @TableField("payback_amount")
    private BigDecimal paybackAmount;
}
